<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="a_vuejs/vue.global.js"></script>

</head>
<body>

<div id="app">
    <button v-on:click="login(100,'张三')">登录</button>
    <button @click="register(200,'李四')">注册</button><br/>
    累加器: 点击加法
    count
    <button @click="count>1?count--:count">-</button>
    {{count}}
    <button @click="count++">+</button><br/>
    <span v-if="count<=1" style="background-color: crimson">数量最小是1</span>
</div>

</body>

<script>
    Vue.createApp({
        data() {
            return {
                count:1
            }
        },
        methods: {
            login(id,userName){
                console.log(id)
                console.log(userName)
            },
            register:function(id,userName){
                console.log(id)
                console.log(userName)
            }
        }
    }).mount("#app")
</script>

</html>